﻿using System.Diagnostics;
using ebcmassendaten.specifications;

namespace ebcmassendaten.fileadapter
{
  public class FileAdapter : IFileAdapter
  {
    #region IFileAdapter Members

    public void In_ReadFile(string filename)
    {
      Out_Line(string.Format("{0};Second Column", filename));
      Trace.TraceInformation("Header fired: Filename:{0}", filename);

      for (var i = 0; i < 100; ++i)
      {
        Out_Line(string.Format("0_{0};1_{1}", i, i));
        Trace.TraceInformation("Line sent: LineNumber:{0}", i);
        Out_Progress(i);
        Trace.TraceInformation("Progress sent: Progress:{0}", i);
      }

      //Out_Line(null);
      //Trace.TraceInformation("EOF sent");
    }

    public event System.Action<string> Out_Line;

    public event System.Action<double> Out_Progress;

    #endregion
  }
}
